<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: PrefsStorage</title>

<!--
    <script src="http://shjs.sourceforge.net/sh_main.min.js"> </script>
    <script src="http://shjs.sourceforge.net/lang/sh_javascript.min.js"> </script>
-->
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/node-dark.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">
    
    <h1 class="page-title">Class: PrefsStorage</h1>
    
    



<section>
    
<header>
    <h2>
        <span class="ancestors"><a href="module-prefs.html">prefs</a>.</span>
    
    PrefsStorage
    </h2>
    
</header>  

<article>
    <div class="container-overview">
    
    
    
        
<dt>
    <h4 class="name" id="PrefsStorage"><span class="type-signature"></span>new PrefsStorage</h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        <p>Constructor for a <code>PrefsStorage</code> object that can be saved to the Fireworks
preferences file.  Any properties added to the object will be saved when
you call its <code>save()</code> method.  To recover the stored data, instantiate
a new object with the same name that was originally used to save the 
preference:</p>

<pre><code>var settings = new prefs.PrefsStorage("MySettings", { foo: 42 });
alert(settings.foo); // 42
settings.foo = "bar";
settings.baz = "hello, world";
settings.save();
var newSettings = new prefs.PrefsStorage("MySettings", { foo: 42 });
alert(newSettings.foo); // "bar"
alert(newSettings.baz); // "hello, world"
</code></pre>

<p>Note that the properties <code>save</code> and <code>remove</code> are reserved and cannot be
modified on a <code>PrefsStorage</code> instance.</p>
    </div>
    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Argument</th>
		
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>inName</code></td>
            
            
            <td class="type">
            
                        String
                        
                    
            </td>
            
            
                <td class="attributes">
                
                    
                
                </td>
            
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last"><p>The name of the preference.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>inDefaults</code></td>
            
            
            <td class="type">
            
                        Object
                        
                    
            </td>
            
            
                <td class="attributes">
                
                    &lt;optional><br>
                
                    
                
                </td>
            
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last"><p>An optional object containing default 
properties that will be added to the stored preference data, if any.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
	
	
	

	
	
	
	
	
	
	
	
	
	
	
	
	
	<dt class="tag-source">Source:</dt>
	<dd class="tag-source"><ul class="dummy"><li>lib/fwlib/prefs.js, line 134</li></ul></dd>
	
    
    
	
	
	
	
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>A <code>PrefsStorage</code> instance with all of the properties 
of the previously stored instance, if any.</p>
</div>




<dl>
	<dt>
		Type
	</dt>
	<dd>
		
		<span class="param-type">Object</span> 
		
	</dd>
</dl>

        
    
    
</dd>

    
    </div>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
        <h3 class="subsection-title">Methods</h3>
        
        <dl>
            
<dt>
    <h4 class="name" id="remove"><span class="type-signature"></span>remove</h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        <p>Sets the named preference to <code>null</code> in the Fireworks preferences 
file, since there is no way to fully remove a value from that file.</p>
    </div>
    
    
    
    
    
    
    
<dl class="details">
    
        
	
	
	

	
	
	
	
	
	
	
	
	
	
	
	
	
	<dt class="tag-source">Source:</dt>
	<dd class="tag-source"><ul class="dummy"><li>lib/fwlib/prefs.js, line 158</li></ul></dd>
	
    
    
	
	
	
	
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="save"><span class="type-signature"></span>save</h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        <p>Saves all of non-method properties of the <code>PrefsStorage</code> instance
to the Fireworks preferences file as a JSON string.</p>
    </div>
    
    
    
    
    
    
    
<dl class="details">
    
        
	
	
	

	
	
	
	
	
	
	
	
	
	
	
	
	
	<dt class="tag-source">Source:</dt>
	<dd class="tag-source"><ul class="dummy"><li>lib/fwlib/prefs.js, line 145</li></ul></dd>
	
    
    
	
	
	
	
</dl>

    
    
    
    
    
    
    
    
</dd>

        </dl>
    
    
    
    
    
</article>

</section>  




</div>

<nav>
    <h2><a href="index.html">Index</a></h2><h3>Modules</h3><ul><li><a href="module-DomStorage.html">DomStorage</a></li><li><a href="module-files.html">files</a></li><li><a href="module-fonts.html">fonts</a></li><li><a href="module-layers.html">layers</a></li><li><a href="module-prefs.html">prefs</a></li><li><a href="module-underscore.html">underscore</a></li></ul><h3>Classes</h3><ul><li><a href="a321565296.html">DomStorage</a></li><li><a href="module-layers.Layer.html">Layer</a></li><li><a href="module-layers.LayerTree.html">LayerTree</a></li><li><a href="module-prefs.PrefsStorage.html">PrefsStorage</a></li><li><a href="_.html">_</a></li></ul>
</nav>

<br clear="both">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3</a> on Mon Jul 08 2013 09:13:10 GMT-0700 (PDT)
</footer>

<script> sh_highlightDocument(); </script>
</body>
</html>
